<template>
	<li>
		<slot></slot>
		<switch :states="info.state" v-ref:switch @message="getState"></switch>
	</li>
</template>
<script>
	import Switch from './../public/Switch'
	import {updateSet} from './../../vuex/action'
	export default {
		components: {
			Switch
		},
		props: ['info'],
		methods: {
			getState: function (value) {
				this.updateSet(this.info.key, value)
			}
		},
		vuex: {
			actions: {
				updateSet
			},
			getters: {
				set: function (state) {
					console.log(state.set)
					return state.set
				}
			}
		}
	}
</script>